const Sequelize = require('sequelize');
const sequelize = require('../libs/sequelize')

const User = require('./user')
const Songs = sequelize.define('songs', {
    id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    name: {
        type: Sequelize.STRING
    },
    copywriter: {
        type: Sequelize.STRING,
    },
    picUrl: {
        type: Sequelize.STRING,
    },
    desc: {
        type: Sequelize.STRING,
    },
    playCount: {
        type: Sequelize.INTEGER,
        allowNull: true
    },
    trackCount: {
        type: Sequelize.INTEGER
    },
    userId: {
        type: Sequelize.INTEGER
    }
});


// Songs.sync({ force: true })

Songs.belongsTo(User)

module.exports = Songs